﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HR_ctrUserSearch_Multi.ascx.cs" Inherits="vHCS.Web.MdlHR.Controls.HR_ctrUserSearch_Multi" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="Core.Controls" Namespace="Core.Controls.DataReader" TagPrefix="core" %>

<div class="div6Column">
    <div class="label"><asp:Label ID="lblEmpCode_L" runat="server" Text="Mã NV" 
            meta:resourcekey="lblEmpCode_LResource1" ></asp:Label></div>
    <div class="control">
        <asp:TextBox ID="txtEmpCode" runat="server" MaxLength="50" Width="80%" 
            CssClass="inputTextUserSearch" onkeypress="KeypreessEnter(this,event)" meta:resourcekey="txtEmpCodeResource1" ></asp:TextBox>
        <asp:Button ID="btnChooseEmpCode" runat="server" Width="15%" Text="..." 
            OnClientClick="ctrlUserSearch_popupManger.OpenSelectEmployeePopup();return false;" meta:resourcekey="btnChooseEmpCodeResource1" 
             />
    </div>
   
    <div class="label"><asp:Label ID="lblEmpName_L" runat="server" Text="Họ tên" 
           ></asp:Label></div>
    <div class="control">
        <asp:TextBox ID="txtEmpName" runat="server" MaxLength="255" Width="80%" 
            CssClass="inputTextUserSearch" onkeypress="KeypreessEnter(this,event)" meta:resourcekey="txtEmpNameResource1"></asp:TextBox>
         <asp:Button ID="btnChooseEmpName" Width="15%" runat="server" Text="..." 
            OnClientClick="ctrlUserSearch_popupManger.OpenSelectEmployeePopup(); return false;" 
            meta:resourcekey="btnChooseEmpNameResource1" />
    </div>
    <div class="label">
        <asp:Label ID="Label3" runat="server" Text="Tên đăng nhập" 
           ></asp:Label>
    </div>
    <div class="controlLast">
        <asp:RegularExpressionValidator ID="valCheckUsernames" CssClass="validation" runat="server"  Display="Dynamic" ControlToValidate="txtUsernames"
             SetFocusOnError="true" ValidationExpression="((\s)*\w(\w)*;?(\s)*)*" ValidationGroup="Search"
            ErrorMessage="Tên đăng nhập không hợp lệ"></asp:RegularExpressionValidator>
        <asp:TextBox ID="txtUsernames" MaxLength="500" runat="server" Width="99.7%" 
            CssClass="inputText" ToolTip="Nhập nhiều người dùng ngăn cách nhau bởi dấu ';'" onkeypress="KeypreessEnter(this,event)" 
           />
    </div>
    <div class="divClear"></div>
</div>

<div class="div6Column">
    <div class="label"><asp:Label ID="lblOrgchart_L" runat="server" 
            Text="Cơ cấu tổ chức" meta:resourcekey="lblOrgchart_LResource1" ></asp:Label></div>
    <div class="div5Colum" >
       <telerik:RadComboBox ID="cboOrgChart" runat="server"  Width="100.5%" 
            Height="200px" Filter="Contains" EmptyMessage="Chọn cơ cấu tổ chức" 
                ExpandAnimation-Type="None" OnClientKeyPressing="KeypreessEnter" 
            CollapseAnimation-Type="None" >
                <ItemTemplate>
                    <div class="noneItem" onclick="ctrlUserSearch_treeOrgChart.noneItemClick();"">
                    </div>
                    <div class="divTreeOnRadCombo" id="divOrgChart" onclick="treeOrgChart.StopPropagation(event);">
                        <telerik:RadTreeView runat="server" ID="trvOrgChart" Width="100%"    
                            OnClientNodeChecking="CheckNodeInCombo" 
                             DataFieldID="HierarchyId" DataFieldParentID ="ParentId"  DataSourceID="dtsOrgChart"
                             DataTextField="HierarchyName" DataValueField="HierarchyId"
                             CheckBoxes="true" >  
                                                 
                        </telerik:RadTreeView>
                    </div>
                    <div class="divButton">
                        <asp:LinkButton ID="btnCollapseAll" CssClass="treeCollapse" 
                            OnClientClick="treeExpandCollapse.treeCollapseAllNodes(); return false;" 
                            runat="server"  Text="Thu nhỏ"></asp:LinkButton>
                        <asp:LinkButton ID="btnExpandAll" CssClass="treeExpand" 
                            OnClientClick="treeExpandCollapse.treeExpandAllNodes(); return false;" 
                            runat="server"  Text="Mở rộng"></asp:LinkButton>
                         
                    </div>

                </ItemTemplate>
            <Items>
                        <telerik:RadComboBoxItem Text="" Value="" 
                            />
                    </Items>

<ExpandAnimation Type="None"></ExpandAnimation>

<CollapseAnimation Type="None"></CollapseAnimation>
        </telerik:RadComboBox>
          <core:CoreDataSource ID="dtsOrgChart" runat="server" SelectMethod="FindOrgChart"
                                TypeName="vHCS.HR.Business.HIE_HierarchyCollection" 
                        MaximumRowsParameterName="">
                </core:CoreDataSource>
    </div>
    <div class="divClear"></div>
</div>


<div id="advancedSearch" style="width:100%; display:block" >
    <div class="div6Column">
        <div class="label"><asp:Label ID="lblJobChart_L" runat="server" 
                Text="Cơ cấu nghề nghiệp chuyên môn" meta:resourcekey="lblJobChart_LResource1" ></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboProChart" runat="server"  Width="99%" 
                Height="200px"  DropDownWidth="500px" Filter="Contains" 
                AutoPostBack="True" 
                EmptyMessage="Chọn cơ cấu chuyên môn" ExpandAnimation-Type="None" OnClientKeyPressing="KeypreessEnter" 
                CollapseAnimation-Type="None">
                <ItemTemplate>
                    <div class="noneItem" onclick="noneItemClickPro()">
                        
                    </div>
                    <div  class="divTreeOnRadCombo" id="divProChart" onclick="treeProChart.StopPropagation(event);">
                        <telerik:RadTreeView runat="server" ID="trvProChart" Width="100%"  
                            DataFieldID="HierarchyId" DataFieldParentID ="ParentId"  DataSourceID="dtsProChart"
                            DataTextField="HierarchyName" DataValueField="HierarchyId"
                            CheckBoxes="true"
                            OnClientNodeChecking="CheckNodeInProCombo" 
                            >                            
                        </telerik:RadTreeView>
                    </div>
                    <div class="divButton">
                        <asp:LinkButton ID="btnCollapseAll" CssClass="treeCollapse" 
                            OnClientClick="treeProJobChart.treeCollapseAllNodes(); return false;" 
                            runat="server" >Thu nhỏ</asp:LinkButton>
                        <asp:LinkButton ID="btnExpandAll" CssClass="treeExpand" 
                            OnClientClick="treeProJobChart.treeExpandAllNodes(); return false;" 
                            runat="server">Mở rộng</asp:LinkButton>
                    </div>
                </ItemTemplate>
                <Items>
                    <telerik:RadComboBoxItem Text="" Value="" 
                       />
                </Items>
                <ExpandAnimation Type="None"></ExpandAnimation>
                <CollapseAnimation Type="None"></CollapseAnimation>
            </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsProChart" runat="server" SelectMethod="FindProChart"
                    TypeName="vHCS.HR.Business.HIE_HierarchyCollection" 
                MaximumRowsParameterName="">                   
            </core:CoreDataSource>
        </div>
        <div class="label"><asp:Label ID="Label4" runat="server" Text="Ranking" 
                meta:resourcekey="Label4Resource1" ></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboProRanking" DataSourceID="dtsProRanking"  
                Filter="Contains" AllowCustomText="false" MarkFirstMatch="true" EnableLoadOnDemand="true" OnClientTextChange="SetEmpty"
                DataTextField="Name" DataValueField="Id" Width="100%" runat="server" OnClientKeyPressing="KeypreessEnter" 
               OnClientSelectedIndexChanging="ctrlUserSearch_chkProRanking.OnClientSelectedIndexChanging"
                OnClientLoad="ctrlUserSearch_chkProRanking.OnClientLoad"
                OnClientDropDownClosing="ctrlUserSearch_chkProRanking.OnClientDropDownClosing"     
                OnClientBlur="ctrlUserSearch_chkProRanking.OnClientBlur" 
               >  
              
                <ItemTemplate>
                    <div style="width:100%"  onclick="ctrlUserSearch_chkProRanking.OnClick(this,event);">                   
                        <asp:CheckBox runat="server" ID="chkProRanking"
                         onclick="ctrlUserSearch_chkProRanking.OnClick(this,event);" 
                         Text=""/>
                            <%# DataBinder.Eval(Container, "Text") %>    
                    </div>              
                </ItemTemplate> 
                <FooterTemplate>
                    <div class="divButton">
                        <asp:LinkButton ID="LinkButton1" OnClientClick="ctrlUserSearch_chkProRanking.SelectAll();return false;" CssClass="selectAll" runat="server">Chọn tất cả</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton2" OnClientClick="ctrlUserSearch_chkProRanking.DeselectAll();return false;" CssClass="deselectAll" runat="server">Bỏ chọn</asp:LinkButton>
                    </div>
                </FooterTemplate> 
                </telerik:RadComboBox>        
            <core:CoreDataSource ID="dtsProRanking"  runat="server" 
                SelectMethod="GetComboItems"  
                TypeName="vHCS.LS.Business.LS_RankingLevelCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="false" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                      
                </SelectParameters>
            </core:CoreDataSource>  
            <div style="display:none">           
                <asp:TextBox ID="hdfProRanking" Text="" runat="server"></asp:TextBox>
            </div>
        </div>
          <div class="label"><asp:Label ID="Label5" runat="server" Text="Grade" 
                  meta:resourcekey="Label5Resource1" ></asp:Label></div>
        <div class="controlLast">
            <telerik:RadComboBox ID="cboProGrade" Width="100%" DataSourceID="dtsProGrade" 
                runat="server" DataTextField="Name" DataValueField="Id" EnableLoadOnDemand="true" OnClientTextChange="SetEmpty"
                Filter="Contains" AllowCustomText="false" MarkFirstMatch="true" OnClientKeyPressing="KeypreessEnter" 
                OnClientSelectedIndexChanging="ctrlUserSearch_chkProGrade.OnClientSelectedIndexChanging"
                OnClientLoad="ctrlUserSearch_chkProGrade.OnClientLoad"
                OnClientDropDownClosing="ctrlUserSearch_chkProGrade.OnClientDropDownClosing"     
                OnClientBlur="ctrlUserSearch_chkProGrade.OnClientBlur" 
               >  
              
                <ItemTemplate>
                    <div style="width:100%"  onclick="ctrlUserSearch_chkProGrade.OnClick(this,event);">                   
                        <asp:CheckBox runat="server" ID="chkProGrade"
                         onclick="ctrlUserSearch_chkProGrade.OnClick(this,event);" 
                         Text=""/>
                            <%# DataBinder.Eval(Container, "Text") %>    
                    </div>              
                </ItemTemplate> 
                <FooterTemplate>
                    <div class="divButton">
                        <asp:LinkButton ID="LinkButton1" OnClientClick="ctrlUserSearch_chkProGrade.SelectAll();return false;" CssClass="selectAll" runat="server">Chọn tất cả</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton2" OnClientClick="ctrlUserSearch_chkProGrade.DeselectAll();return false;" CssClass="deselectAll" runat="server">Bỏ chọn</asp:LinkButton>
                    </div>    
                </FooterTemplate> 
                </telerik:RadComboBox>  
             <core:CoreDataSource ID="dtsProGrade"  runat="server" 
                SelectMethod="GetComboItems" 
                TypeName="vHCS.LS.Business.LS_GradeCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />  
                    <asp:Parameter Name="addNullItem" DefaultValue="false" Type="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" Type="Boolean" />                  
                </SelectParameters>
            </core:CoreDataSource>  
             <div style="display:none">           
                <asp:TextBox ID="hdfProGrade" Text="" runat="server"></asp:TextBox>
            </div>
        </div>
        <div class="divClear"></div>
    </div>
    
    <div class="div6Column">
        <div class="label"><asp:Label ID="Label1" runat="server" Text="Cơ cấu nghề nghiệp quản lý" 
                meta:resourcekey="Label1Resource1" ></asp:Label></div>
        <div class="control">
             <telerik:RadComboBox ID="cboMgtChart" runat="server"  Width="99%" 
                 Height="200px" DropDownWidth="500px" OnClientKeyPressing="KeypreessEnter" 
                AutoPostBack="True" 
                EmptyMessage="Chọn cơ cấu quản lý" ExpandAnimation-Type="None" 
                 CollapseAnimation-Type="None"  Filter="Contains" 
                 >
                <ItemTemplate>
                    <div class="noneItem" id="noneItem"  onclick="noneItemClickMgt()">
                        
                    </div>
                    <div class="divTreeOnRadCombo" id="divMgtChart"  onclick="treeMgtChart.StopPropagation(event);" >
                        <telerik:RadTreeView runat="server" ID="trvMgtChart" Width="100%" 
                            DataFieldID="HierarchyId" DataFieldParentID ="ParentId"  DataSourceID="dtsMgtChart"
                            DataTextField="HierarchyName" DataValueField="HierarchyId" 
                           
                          
                            CheckBoxes="true"
                              OnClientNodeChecking="CheckNodeInMgtCombo" >                            
                        </telerik:RadTreeView>
                    </div>
                     <div class="divButton">
                        <asp:LinkButton ID="btnCollapseAll" CssClass="treeCollapse" 
                             OnClientClick="treeMgtJobChart.treeCollapseAllNodes(); return false;" 
                             runat="server" meta:resourcekey="btnCollapseAllResource3">Thu nhỏ</asp:LinkButton>
                        <asp:LinkButton ID="btnExpandAll" CssClass="treeExpand" 
                             OnClientClick="treeMgtJobChart.treeExpandAllNodes(); return false;" 
                             runat="server" meta:resourcekey="btnExpandAllResource3">Mở rộng</asp:LinkButton>
                    </div>
                </ItemTemplate>
                <Items>
                    <telerik:RadComboBoxItem Text="" Value="" 
                        meta:resourcekey="RadComboBoxItemResource3" />
                </Items>
                <ExpandAnimation Type="None"></ExpandAnimation>
                <CollapseAnimation Type="None"></CollapseAnimation>
            </telerik:RadComboBox>
             <core:CoreDataSource ID="dtsMgtChart" runat="server" SelectMethod="FindMgtChart"
                    TypeName="vHCS.HR.Business.HIE_HierarchyCollection" 
                 MaximumRowsParameterName="">                   
            </core:CoreDataSource>
        </div>
         <div class="label"><asp:Label ID="Label2" runat="server" Text="Ranking" 
                 meta:resourcekey="Label2Resource1" ></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboMgtRanking" Width="100%" runat="server" EnableLoadOnDemand="true" OnClientTextChange="SetEmpty"
                DataSourceID="dtsMgtRanking" DataTextField="Name" DataValueField="Id" 
                Filter="Contains" AllowCustomText="false" MarkFirstMatch="true" OnClientKeyPressing="KeypreessEnter" 
                OnClientSelectedIndexChanging="ctrlUserSearch_chkMgtRanking.OnClientSelectedIndexChanging"
                OnClientLoad="ctrlUserSearch_chkMgtRanking.OnClientLoad"
                OnClientDropDownClosing="ctrlUserSearch_chkMgtRanking.OnClientDropDownClosing"     
                OnClientBlur="ctrlUserSearch_chkMgtRanking.OnClientBlur" 
               >  
              
                <ItemTemplate>
                    <div style="width:100%"  onclick="ctrlUserSearch_chkMgtRanking.OnClick(this,event);">                   
                        <asp:CheckBox runat="server" ID="chkMgtRanking"
                         onclick="ctrlUserSearch_chkMgtRanking.OnClick(this,event);" 
                         Text=""/>
                            <%# DataBinder.Eval(Container, "Text") %>    
                    </div>              
                </ItemTemplate> 
                <FooterTemplate>
                    <div class="divButton">
                        <asp:LinkButton ID="LinkButton1" OnClientClick="ctrlUserSearch_chkMgtRanking.SelectAll();return false;" CssClass="selectAll" runat="server">Chọn tất cả</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton2" OnClientClick="ctrlUserSearch_chkMgtRanking.DeselectAll();return false;" CssClass="deselectAll" runat="server">Bỏ chọn</asp:LinkButton>
                    </div>    
                </FooterTemplate> 
                </telerik:RadComboBox>          
            <core:CoreDataSource ID="dtsMgtRanking"  runat="server" 
                SelectMethod="GetComboItems" 
                TypeName="vHCS.LS.Business.LS_RankingLevelCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="false" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                       
                </SelectParameters>
            </core:CoreDataSource> 
            <div style="display:none">           
                <asp:TextBox ID="hdfMgtRanking" Text="" runat="server"></asp:TextBox>
            </div>
        </div>
        <div class="label"><asp:Label ID="Label6" runat="server" Text="Grade" 
                meta:resourcekey="Label6Resource1" ></asp:Label></div>
        <div class="controlLast">
            <telerik:RadComboBox ID="cboMgtGrade" Width="100%" runat="server" EnableLoadOnDemand="true" OnClientTextChange="SetEmpty"
                Filter="Contains" AllowCustomText="false" MarkFirstMatch="true"
                DataSourceID="dtsMgtGrade" DataTextField="Name" DataValueField="Id" OnClientKeyPressing="KeypreessEnter" 
                OnClientSelectedIndexChanging="ctrlUserSearch_chkMgtGrade.OnClientSelectedIndexChanging"
                OnClientLoad="ctrlUserSearch_chkMgtGrade.OnClientLoad"
                OnClientDropDownClosing="ctrlUserSearch_chkMgtGrade.OnClientDropDownClosing"     
                OnClientBlur="ctrlUserSearch_chkMgtGrade.OnClientBlur" 
               >  
             
                <ItemTemplate>
                    <div style="width:100%"  onclick="ctrlUserSearch_chkMgtGrade.OnClick(this,event);">                   
                        <asp:CheckBox runat="server" ID="chkMgtGrade"
                         onclick="ctrlUserSearch_chkMgtGrade.OnClick(this,event);" 
                         Text=""/>
                            <%# DataBinder.Eval(Container, "Text") %>    
                    </div>              
                </ItemTemplate> 
                <FooterTemplate>
                    <div class="divButton">
                        <asp:LinkButton ID="btnSelectAll" OnClientClick="ctrlUserSearch_chkMgtGrade.SelectAll();return false;" CssClass="selectAll" runat="server">Chọn tất cả</asp:LinkButton>
                        <asp:LinkButton ID="btnUnSelectAll" OnClientClick="ctrlUserSearch_chkMgtGrade.DeselectAll();return false;" CssClass="deselectAll" runat="server">Bỏ chọn</asp:LinkButton>
                    </div>    
                </FooterTemplate> 
                </telerik:RadComboBox>          
            <core:CoreDataSource ID="dtsMgtGrade"  runat="server" 
                SelectMethod="GetComboItems" 
                TypeName="vHCS.LS.Business.LS_GradeCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="false" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                      
                </SelectParameters>
            </core:CoreDataSource> 
            <div style="display:none">           
                <asp:TextBox ID="hdfMgtGrade" Text="" runat="server"></asp:TextBox>
            </div>
        </div>
        <div class="divClear"></div>
    </div>
    
    <div class="div6Column">
        <div class="label"><asp:Label ID="lblJobLevel_L" runat="server" Text="Cấp bậc" 
                meta:resourcekey="lblJobLevel_LResource1" ></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboJobLevel" Width="100%"  runat="server"  
                Filter="Contains" MarkFirstMatch="True" AllowCustomText="false" EnableLoadOnDemand="true" OnClientTextChange="SetEmpty"
                DataSourceID="dtsJobLevel" DataTextField="Name" DataValueField="Id" 
                onselectedindexchanged="cboJobLevel_SelectedIndexChanged" OnClientKeyPressing="KeypreessEnter" 
                AutoPostBack="True"
                OnClientSelectedIndexChanging="ctrlUserSearch_chkJobLevel.OnClientSelectedIndexChanging"
                OnClientLoad="ctrlUserSearch_chkJobLevel.OnClientLoad"
                OnClientDropDownClosing="ctrlUserSearch_chkJobLevel.OnClientDropDownClosing"     
                OnClientBlur="ctrlUserSearch_chkJobLevel.OnClientBlur" 
               >  
                <ItemTemplate>
                    <div style="width:100%"  onclick="ctrlUserSearch_chkJobLevel.OnClick(this,event);">                   
                        <asp:CheckBox runat="server" ID="chkJobLevel"
                         onclick="chkJobLevel_onclick()" 
                         Text=""/>
                            <%# DataBinder.Eval(Container, "Text") %>    
                    </div>              
                </ItemTemplate> 
                <FooterTemplate>
                    <div class="divButton">
                        <asp:LinkButton ID="btnSelectAll" OnClientClick="ctrlUserSearch_chkJobLevel.SelectAll();return false;" CssClass="selectAll" runat="server">Chọn tất cả</asp:LinkButton>
                        <asp:LinkButton ID="btnUnSelectAll" OnClientClick="ctrlUserSearch_chkJobLevel.DeselectAll();return false;" CssClass="deselectAll" runat="server">Bỏ chọn</asp:LinkButton>
                    </div>    
                </FooterTemplate>                  
           </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsJobLevel"  runat="server" SelectMethod="GetComboItems" 
                TypeName="vHCS.LS.Business.LS_JobLevelCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="p_strPrefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="p_bAddNullItem" DefaultValue="true" DbType="Boolean" /> 
                    <asp:Parameter Name="p_bGetTop" DefaultValue="false" DbType="Boolean" />                     
                </SelectParameters>
            </core:CoreDataSource> 
            <div style="display:none">           
                <asp:TextBox ID="hdfJobLevel" Text="" runat="server"></asp:TextBox>
            </div>
        </div>
        <div class="label"><asp:Label ID="lblJobTitle_L" runat="server" Text="Chức vụ" 
                meta:resourcekey="lblJobTitle_LResource1"></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboJobTitle" Width="100%" 
                Filter="Contains"  AllowCustomText="false" MarkFirstMatch="true" EnableLoadOnDemand="true" OnClientTextChange="SetEmpty"
                DataSourceID="dtsJobTitle"  runat="server" DataTextField="Name" OnClientKeyPressing="KeypreessEnter" 
                DataValueField="Id"  OnClientSelectedIndexChanging="ctrlUserSearch_chkJobTitle.OnClientSelectedIndexChanging"
                OnClientLoad="ctrlUserSearch_chkJobTitle.OnClientLoad"
                OnClientDropDownClosing="ctrlUserSearch_chkJobTitle.OnClientDropDownClosing"     
                OnClientBlur="ctrlUserSearch_chkJobTitle.OnClientBlur" 
               >  
                <ItemTemplate>
                    <div style="width:100%"  onclick="ctrlUserSearch_chkJobTitle.OnClick(this,event);">                   
                        <asp:CheckBox runat="server" ID="chkJobTitle"
                         onclick="ctrlUserSearch_chkJobTitle.OnClick(this,event);" 
                         Text=""/>
                            <%# DataBinder.Eval(Container, "Text") %>    
                    </div>              
                </ItemTemplate> 
                <FooterTemplate>
                    <div class="divButton">
                        <asp:LinkButton ID="btnSelectAll" OnClientClick="ctrlUserSearch_chkJobTitle.SelectAll();return false;" CssClass="selectAll" runat="server">Chọn tất cả</asp:LinkButton>
                        <asp:LinkButton ID="btnUnSelectAll" OnClientClick="ctrlUserSearch_chkJobTitle.DeselectAll();return false;" CssClass="deselectAll" runat="server">Bỏ chọn</asp:LinkButton>
                    </div>    
                </FooterTemplate>             
            </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsJobTitle"  runat="server" 
                SelectMethod="GetComboItemsMulti" 
                TypeName="vHCS.LS.Business.LS_JobTitleCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="jobLevelId" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="jobFamilyId" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="jobGroupId" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="subGroupId" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="false" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                  
                </SelectParameters>
            </core:CoreDataSource> 
             <div style="display:none">           
                <asp:TextBox ID="hdfJobTitle" Text="" runat="server"></asp:TextBox>
            </div>
        </div>
      
      <div class="label"><asp:Label ID="Label7" runat="server" Text="Job Role" ></asp:Label></div>
        <div class="controlLast">
            <telerik:RadComboBox ID="cboJobRole" Width="100%"  
                DataTextField="Name" DataValueField="Id" DataSourceID="dtsJobRole"  
                 AllowCustomText="true"
                HighlightTemplatedItems="true" Filter="Contains" EnableLoadOnDemand="true" OnClientTextChange="SetEmpty"
                OnClientSelectedIndexChanging="ctrlUserSearch_chkJobRole.OnClientSelectedIndexChanging"
                OnClientLoad="ctrlUserSearch_chkJobRole.OnClientLoad"
                OnClientDropDownClosing="ctrlUserSearch_chkJobRole.OnClientDropDownClosing"     
                OnClientBlur="ctrlUserSearch_chkJobRole.OnClientBlur" 
                OnClientKeyPressing="KeypreessEnter"                                    
                runat="server">    
                <ItemTemplate>
                    <div style="width:100%"  onclick="ctrlUserSearch_chkJobRole.OnClick(this,event);">                   
                        <asp:CheckBox runat="server" ID="chkJobRole"
                         onclick="ctrlUserSearch_chkJobRole.OnClick(this,event);" 
                         Text=""/>
                            <%# DataBinder.Eval(Container, "Text") %>    
                    </div>              
                </ItemTemplate> 
                <FooterTemplate>
                    <div class="divButton">
                        <asp:LinkButton ID="btnSelectAll" OnClientClick="ctrlUserSearch_chkJobRole.SelectAll();return false;" CssClass="selectAll" runat="server">Chọn tất cả</asp:LinkButton>
                        <asp:LinkButton ID="btnUnSelectAll" OnClientClick="ctrlUserSearch_chkJobRole.DeselectAll();return false;" CssClass="deselectAll" runat="server">Bỏ chọn</asp:LinkButton>
                    </div>    
                </FooterTemplate>               
            </telerik:RadComboBox>
           
            
             <core:CoreDataSource ID="dtsJobRole"  runat="server" SelectMethod="GetComboItems" 
                TypeName="vHCS.LS.Business.LS_JobRoleCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="false" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                     
                </SelectParameters>
            </core:CoreDataSource> 
            <div style="display:none">           
                <asp:TextBox ID="hdfJobRoles" Text="" runat="server"></asp:TextBox>
            </div>
        </div>
         
        <div class="divClear"></div>
    </div>   

    <div class="div6Column">
        <div class="label"><asp:Label ID="lblEmpType_L" runat="server" 
                Text="Loại nhân viên" meta:resourcekey="lblEmpType_LResource1" ></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboEmpType" Width="100%" runat="server" EnableLoadOnDemand="true" OnClientTextChange="SetEmpty"
                Filter="Contains" DataSourceID="dtsEmpType" DataTextField="Name"  
                AllowCustomText="false"  MarkFirstMatch="true" OnClientKeyPressing="KeypreessEnter" 
                DataValueField="Id" 
                OnClientSelectedIndexChanging="ctrlUserSearch_chkEmpType.OnClientSelectedIndexChanging"
                OnClientLoad="ctrlUserSearch_chkEmpType.OnClientLoad"
                OnClientDropDownClosing="ctrlUserSearch_chkEmpType.OnClientDropDownClosing"     
                OnClientBlur="ctrlUserSearch_chkEmpType.OnClientBlur" 
               >  
                <ItemTemplate>
                    <div style="width:100%"  onclick="ctrlUserSearch_chkEmpType.OnClick(this,event);">                   
                        <asp:CheckBox runat="server" ID="chkEmpType"
                         onclick="ctrlUserSearch_chkEmpType.OnClick(this,event);" 
                         Text=""/>
                            <%# DataBinder.Eval(Container, "Text") %>    
                    </div>              
                </ItemTemplate> 
                <FooterTemplate>
                    <div class="divButton">
                        <asp:LinkButton ID="btnSelectAll" OnClientClick="ctrlUserSearch_chkEmpType.SelectAll();return false;" CssClass="selectAll" runat="server">Chọn tất cả</asp:LinkButton>
                        <asp:LinkButton ID="btnUnSelectAll" OnClientClick="ctrlUserSearch_chkEmpType.DeselectAll();return false;" CssClass="deselectAll" runat="server">Bỏ chọn</asp:LinkButton>
                    </div>    
                </FooterTemplate>        
            </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsEmpType"  runat="server" 
                SelectMethod="GetComboItems" 
                TypeName="vHCS.LS.Business.LS_EmpTypeCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="p_strPrefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="p_bAddNullItem" DefaultValue="true" DbType="Boolean" /> 
                    <asp:Parameter Name="p_bGetTop" DefaultValue="false" DbType="Boolean" />                    
                </SelectParameters>
            </core:CoreDataSource> 
             <div style="display:none">           
                <asp:TextBox ID="hdfEmpType" Text="" runat="server"></asp:TextBox>
            </div>
        </div>
        <div class="label"><asp:Label ID="lblContractType_L" runat="server" 
                Text="Loại hợp đồng" meta:resourcekey="lblContractType_LResource1"></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboContractType" Width="100%"  Filter="Contains" EnableLoadOnDemand="true" OnClientTextChange="SetEmpty"
                AllowCustomText="false"  MarkFirstMatch="true" OnClientKeyPressing="KeypreessEnter" 
                runat="server" DataSourceID="dtsContractType" DataTextField="Name" 
                DataValueField="Id"  OnClientSelectedIndexChanging="ctrlUserSearch_chkContractType.OnClientSelectedIndexChanging"
                OnClientLoad="ctrlUserSearch_chkContractType.OnClientLoad"
                OnClientDropDownClosing="ctrlUserSearch_chkContractType.OnClientDropDownClosing"     
                OnClientBlur="ctrlUserSearch_chkContractType.OnClientBlur" 
               >  
                <ItemTemplate>
                    <div style="width:100%"  onclick="ctrlUserSearch_chkContractType.OnClick(this,event);">                   
                        <asp:CheckBox runat="server" ID="chkContractType"
                         onclick="ctrlUserSearch_chkContractType.OnClick(this,event);" 
                         Text=""/>
                            <%# DataBinder.Eval(Container, "Text") %>    
                    </div>              
                </ItemTemplate> 
                <FooterTemplate>
                    <div class="divButton">
                        <asp:LinkButton ID="btnSelectAll" OnClientClick="ctrlUserSearch_chkContractType.SelectAll();return false;" CssClass="selectAll" runat="server">Chọn tất cả</asp:LinkButton>
                        <asp:LinkButton ID="btnUnSelectAll" OnClientClick="ctrlUserSearch_chkContractType.DeselectAll();return false;" CssClass="deselectAll" runat="server">Bỏ chọn</asp:LinkButton>
                    </div>    
                </FooterTemplate>       
            </telerik:RadComboBox>
             <core:CoreDataSource ID="dtsContractType"  runat="server" 
                SelectMethod="GetComboItems" 
                TypeName="vHCS.LS.Business.LS_ContractTypeCollection" 
                MaximumRowsParameterName="">
                 <SelectParameters>
                    <asp:Parameter Name="p_strPrefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="p_bAddNullItem" DefaultValue="true" DbType="Boolean" /> 
                    <asp:Parameter Name="p_bGetTop" DefaultValue="false" DbType="Boolean" />                    
                </SelectParameters>
            </core:CoreDataSource> 
            <div style="display:none">           
                <asp:TextBox ID="hdfContractType" Text="" runat="server"></asp:TextBox>
            </div>
        </div>
        <div class="label"><asp:Label ID="lblWorkingLocation_L" runat="server" 
                Text="Văn phòng làm việc" meta:resourcekey="lblWorkingLocation_LResource1"></asp:Label></div>
        <div class="controlLast">
            <telerik:RadComboBox ID="cboWorkingLocation" Filter="Contains" EnableLoadOnDemand="true" OnClientTextChange="SetEmpty"
                AllowCustomText="false" MarkFirstMatch="true" OnClientKeyPressing="KeypreessEnter" 
                DataSourceID="dtsWorkingLocation" HighlightTemplatedItems="True" Width="100%"  
                runat="server" DataTextField="Name" DataValueField="Id" 
                OnClientSelectedIndexChanging="ctrlUserSearch_chkWorkingLocation.OnClientSelectedIndexChanging"
                OnClientLoad="ctrlUserSearch_chkWorkingLocation.OnClientLoad"
                OnClientDropDownClosing="ctrlUserSearch_chkWorkingLocation.OnClientDropDownClosing"     
                OnClientBlur="ctrlUserSearch_chkWorkingLocation.OnClientBlur" 
               >  
                <ItemTemplate>
                    <div style="width:100%"  onclick="ctrlUserSearch_chkWorkingLocation.OnClick(this,event);">                   
                        <asp:CheckBox runat="server" ID="chkWorkingLocation"
                         onclick="ctrlUserSearch_chkWorkingLocation.OnClick(this,event);" 
                         Text=""/>
                            <%# DataBinder.Eval(Container, "Text") %>    
                    </div> 
                                  
                </ItemTemplate> 
                <FooterTemplate>
                    <div class="divButton">
                        <asp:LinkButton ID="btnSelectAll" OnClientClick="ctrlUserSearch_chkWorkingLocation.SelectAll();return false;" CssClass="selectAll" runat="server">Chọn tất cả</asp:LinkButton>
                        <asp:LinkButton ID="btnUnSelectAll" OnClientClick="ctrlUserSearch_chkWorkingLocation.DeselectAll();return false;" CssClass="deselectAll" runat="server">Bỏ chọn</asp:LinkButton>
                    </div>    
                </FooterTemplate>  
            </telerik:RadComboBox>
             <core:CoreDataSource ID="dtsWorkingLocation"  runat="server" 
             SelectMethod="GetComboItems" 
                TypeName="vHCS.LS.Business.LS_WorkPlaceCollection"
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="p_strPrefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="p_bAddNullItem" DefaultValue="false" DbType="Boolean" /> 
                    <asp:Parameter Name="p_bGetTop" DefaultValue="false" DbType="Boolean" />                     
                </SelectParameters>
            </core:CoreDataSource> 
            <div style="display:none">           
                <asp:TextBox ID="hdfWorkingLocation" Text="" runat="server"></asp:TextBox>
            </div>
        </div>
        <div class="divClear"></div>
    </div>
    <div class="divClear"></div>
   
    <div class="div6Column">
         <div class="label"><asp:Label ID="lblReportTo_L" runat="server" Text="Báo cáo cho" 
                meta:resourcekey="lblReportTo_LResource1"></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboReportTo" Width="100%" MarkFirstMatch="true" 
                HighlightTemplatedItems="True"  DropDownWidth="500px"  OnClientTextChange="SetEmpty"
                EnableLoadOnDemand="True" OnItemsRequested="RadComboBox_ItemRequested" 
                runat="server" DataSourceID="dtsReportTo" AllowCustomText="false"
                DataTextField="Name" DataValueField="Id" OnClientKeyPressing="KeypreessEnter"  
                OnClientSelectedIndexChanging="ctrlUserSearch_chkReportTo.OnClientSelectedIndexChanging"
                OnClientLoad="ctrlUserSearch_chkReportTo.OnClientLoad"
                OnClientDropDownClosing="ctrlUserSearch_chkReportTo.OnClientDropDownClosing"     
                OnClientBlur="ctrlUserSearch_chkReportTo.OnClientBlur" 
               >  
                <HeaderTemplate>
                    <ul class="comboHeader">
                        <li class="code">
                            <asp:Label ID="Label2" runat="server" Text="Mã" 
                                meta:resourcekey="Label2Resource2"></asp:Label>
                        </li>
                        <li class="name">
                            <asp:Label ID="Label3" runat="server" Text="Tên" 
                                meta:resourcekey="Label3Resource2" ></asp:Label>
                        </li>
                        <li class="divClear"></li>
                    </ul>
                </HeaderTemplate>
                <ItemTemplate>
                    <ul class="comboItem"  onclick="ctrlUserSearch_chkReportTo.OnClick(this,event);">
                        <li class="code">
                         <asp:CheckBox runat="server" ID="chkReportTo" 
                         onclick="ctrlUserSearch_chkReportTo.OnClick(this,event);" 
                         Text=""/>
                            <%#DataBinder.Eval(Container.DataItem, "Code")%>
                        </li>
                        <li class="name">
                             <%#DataBinder.Eval(Container.DataItem, "Name")%>
                        </li>
                    </ul>
               </ItemTemplate>  
               <%-- <ItemTemplate>
              
                    <div  onclick="ctrlUserSearch_chkReportTo.OnClick(this,event);">                   
                    <div class="codeUser">
                        <asp:CheckBox runat="server" ID="chkReportTo" 
                         onclick="ctrlUserSearch_chkReportTo.OnClick(this,event);" 
                         Text=""/>
                         
                         <%#DataBinder.Eval(Container.DataItem, "Id")%>
                          </div>
                          <div class="nameUser" >
                           <asp:Label id="id"  runat="server" Text=' <%#DataBinder.Eval(Container.DataItem, "Name")%>'></asp:Label>

                    </div>   

                </ItemTemplate> --%>
                <FooterTemplate>
                    <div class="divButton">
                        <asp:LinkButton ID="btnSelectAll" OnClientClick="ctrlUserSearch_chkReportTo.SelectAll();return false;" CssClass="selectAll" runat="server">Chọn tất cả</asp:LinkButton>
                        <asp:LinkButton ID="btnUnSelectAll" OnClientClick="ctrlUserSearch_chkReportTo.DeselectAll();return false;" CssClass="deselectAll" runat="server">Bỏ chọn</asp:LinkButton>
                    </div>    
        
                    <div class="comboFooter">
                        <asp:Label ID="Label4" runat="server" Text="Please enter text to show more items"></asp:Label>
                    </div>                   
               </FooterTemplate>       
            </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsReportTo"  runat="server" SelectMethod="GetComboItems" 
                    TypeName="vHCS.SYS.Business.SYS_UsersCollection" 
                    MaximumRowsParameterName="">
                    <SelectParameters>
                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                        <asp:Parameter Name="addNullItem" DefaultValue="false" Type="Boolean" /> 
                        <asp:Parameter Name="getTop" DefaultValue="true" Type="Boolean" />                  
                    </SelectParameters>
            </core:CoreDataSource> 
             <div style="display:none">           
                <asp:TextBox ID="hdfReportTo" Text="" runat="server"></asp:TextBox>
            </div>
        </div>     
        <div class="label"><asp:Label ID="lblBarCode_L" runat="server" Text="Barcode" 
                meta:resourcekey="lblBarCode_LResource1"></asp:Label></div>
        <div class="control"><asp:TextBox ID="txtBarcode" runat="server" Width="80%" 
                CssClass="inputTextUserSearch" onkeypress="KeypreessEnter(this,event)" ></asp:TextBox>
                 <asp:Button ID="btnChooseBarCode" Width="15%" runat="server" Text="..." 
                    OnClientClick="ctrlUserSearch_popupManger.OpenSelectEmployeePopup(); return false;"  />
        </div>
          
           <div class="divClear"></div>
    </div>
    <div class="div6Column">
        <div class="label"><asp:Label ID="lblTerminationStatus_L" runat="server" 
                Text="Tình trạng"  ></asp:Label></div>
     
        <div class="div5Colum">
           <asp:RadioButtonList   ID="rbtTerminationStatus" runat="server" onkeypress="KeypreessEnter(this,event)"
                RepeatDirection="Horizontal">
               <asp:ListItem Value="2" Selected="True" Text="Hiện diện" ></asp:ListItem>
               <asp:ListItem Value="1" Text="Nghỉ việc"></asp:ListItem>
               <asp:ListItem Value="3" Text="Tất cả" 
                   meta:resourcekey="ListItemResource3"></asp:ListItem></asp:RadioButtonList>
        
        </div>    
    </div>
    <div class="divClear"></div>

</div>
<div class="divClear"></div>

<div class="divAdvanced">
     <div class="sep">
           
    </div>
    <div class="label">
        <asp:HyperLink ID="btnExpand" runat="server"  
            onclick='return collapser.showAdvance("1");' ToolTip="Click here to expand" 
            CssClass="divCollapsed"
            Text="Mở rộng"></asp:HyperLink>
        <asp:HyperLink ID="btnCollapse" runat="server"  
            onclick='return collapser.hideAdvance("1");' ToolTip="Click here to collapse"  
            CssClass="divExpanded" 
            Text="Thu nhỏ"></asp:HyperLink>
        <div style="display:none">
            <asp:TextBox ID="hdfAdvanceStatus" runat="server" Text="0" 
                meta:resourcekey="hdfAdvanceStatusResource1"></asp:TextBox>
        </div>
        
    </div>
    
    <div class="divClear"></div>
</div>
<div class="divClear"></div>
<asp:HiddenField ID="hdfEmployeeId" runat="server" />
<div style="display:none">
    <asp:Button ID="btnEmpChanged" runat="server" OnClick="EmployeeChanged" 
        meta:resourcekey="btnEmpChangedResource1" />
</div>
 <div style="display:none">           
                <asp:TextBox ID="txtLevel" Text="" runat="server"></asp:TextBox>
            </div>
<telerik:RadAjaxManager ID="ajaxManager" runat="server" 
    meta:resourcekey="ajaxManagerResource1" onajaxrequest="ajxManager_AjaxRequest">
    <AjaxSettings >
        <telerik:AjaxSetting AjaxControlID="cboJobLevel">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl  ControlID="cboJobTitle" LoadingPanelID="ajaxLoadingPanel"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="cboMgtChart">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl  ControlID="cboJobTitle" LoadingPanelID="ajaxLoadingPanel"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cboProChart">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl  ControlID="cboJobTitle" LoadingPanelID="ajaxLoadingPanel"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
         <telerik:AjaxSetting AjaxControlID="ajaxManager">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl  ControlID="cboJobTitle" LoadingPanelID="ajaxLoadingPanel"/>
               
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="ajaxLoadingPanel" runat="server" 
    meta:resourcekey="ajaxLoadingPanelResource1">
</telerik:RadAjaxLoadingPanel>

<telerik:RadCodeBlock  ID="radCodeBlock" runat="server">
    <script type="text/javascript">
        var ctrlUserSearch_treeOrgChart = new TreeViewInRadCombo("<%=cboOrgChart.ClientID %>", "trvOrgChart");
        var ctrlUserSearch_treeMgtChart = new TreeViewInRadCombo("<%=cboMgtChart.ClientID %>", "trvMgtChart");
        var ctrlUserSearch_treeProChart = new TreeViewInRadCombo("<%=cboProChart.ClientID %>", "trvProChart");
        var ctrlUserSearch_chkJobRole = new CheckBoxInRadCombo("<%=cboJobRole.ClientID %>", "<%=hdfJobRoles.ClientID %>");
        var ctrlUserSearch_chkEmpType = new CheckBoxInRadCombo("<%=cboEmpType.ClientID %>", "<%=hdfEmpType.ClientID %>");
        var ctrlUserSearch_chkJobLevel = new CheckBoxInRadCombo("<%=cboJobLevel.ClientID %>", "<%=hdfJobLevel.ClientID %>");
        var ctrlUserSearch_chkJobTitle = new CheckBoxInRadCombo("<%=cboJobTitle.ClientID %>", "<%=hdfJobTitle.ClientID %>");
        var ctrlUserSearch_chkContractType = new CheckBoxInRadCombo("<%=cboContractType.ClientID %>", "<%=hdfContractType.ClientID %>");
        var ctrlUserSearch_chkWorkingLocation = new CheckBoxInRadCombo("<%=cboWorkingLocation.ClientID %>", "<%=hdfWorkingLocation.ClientID %>");
        var ctrlUserSearch_chkReportTo = new CheckBoxInRadCombo("<%=cboReportTo.ClientID %>", "<%=hdfReportTo.ClientID %>");
        var ctrlUserSearch_chkMgtGrade = new CheckBoxInRadCombo("<%=cboMgtGrade.ClientID %>", "<%=hdfMgtGrade.ClientID %>");
        var ctrlUserSearch_chkMgtRanking = new CheckBoxInRadCombo("<%=cboMgtRanking.ClientID %>", "<%=hdfMgtRanking.ClientID %>");
        var ctrlUserSearch_chkProRanking = new CheckBoxInRadCombo("<%=cboProRanking.ClientID %>", "<%=hdfProRanking.ClientID %>");
        var ctrlUserSearch_chkProGrade = new CheckBoxInRadCombo("<%=cboProGrade.ClientID %>", "<%=hdfProGrade.ClientID %>");

        var treeOrgChart = new TreeViewInRadCombo("<%=cboOrgChart.ClientID %>", "trvOrgChart");
        var treeMgtChart = new TreeViewInRadCombo("<%=cboMgtChart.ClientID %>", "trvMgtChart");
        var treeProChart = new TreeViewInRadCombo("<%=cboProChart.ClientID %>", "trvProChart");
        var collapser = new CollapseExpand("<%=btnExpand.ClientID %>", "<%=btnCollapse.ClientID %>", "advancedSearch", "<%=hdfAdvanceStatus.ClientID %>");
        
        //Set trang thái hiển thị vùng thông tin mở rộng
        collapser.onInit();

        var ctrlUserSearch_popupManger = new UserSearchFormPopupManager();
        function UserSearchFormPopupManager() {
            this.OpenSelectEmployeePopup = function () {
                var callerId = "<%=base.MasterFuntionId %>"

                var txtCode = document.getElementById("<%=txtEmpCode.ClientID %>");
                var txtEmpName = document.getElementById("<%=txtEmpName.ClientID %>");
                var txtBarCode = document.getElementById("<%=txtBarcode.ClientID %>");
                new PopUpManager().Open("../../MdlHR/Controls/HR_PopEmpSelecting.aspx?IsPopup=1&mChoice=0&Caller=" + callerId + "&Barcode=" + encodeURI(txtBarCode.value) + "&EmpName=" + encodeURI(txtEmpName.value) + "&EmpCode=" + encodeURI(txtCode.value));
            }
        }

        ///Xử lý sự kiện chọn nhân viên
        function ReturnEmployee(args) {

            if (args != null && args.length > 0) {
                var hdfEmpId = document.getElementById("<%=hdfEmployeeId.ClientID %>");

                //Nếu thay đổi mã nhân viên
                if (hdfEmpId.value != args[0]) {
                    hdfEmpId.value = args[0];
                    var btnChanged = document.getElementById("<%=btnEmpChanged.ClientID %>");

                    btnChanged.click();
                }
            }

        }
        var treeExpandCollapse = new TreeExpandCollapse("<%=trvOrgChartClientId%>");
        var treeProJobChart = new TreeExpandCollapse("<%=trvProChartClientId %>");
        var treeMgtJobChart = new TreeExpandCollapse("<%=trvMgtChartClientId %>");

        function noneItemClickMgt() {
            var comboBox = $find("<%=cboMgtChart.ClientID %>");
            var treeview = $find("<%=trvMgtChartClientId %>");
            var allnode = treeview.get_allNodes();
            for (var i = 0; i < allnode.length; i++) {
                var node = allnode[i];
                node.set_checked(false);
            }

            comboBox.trackChanges();
            comboBox.get_items().getItem(0).set_text("");
            comboBox.get_items().getItem(0).set_value("");
            comboBox.get_items().getItem(0).select();
            comboBox.commitChanges();
            comboBox.hideDropDown();
            $find("<%= ajaxManager.ClientID %>").ajaxRequest("<%=_REQ_REBIND_ACCOUNTNO%>");

        }
        function noneItemClickPro() {
            var comboBox = $find("<%=cboProChart.ClientID %>");
            var treeview = $find("<%=trvProChartClientId %>");
            var allnode = treeview.get_allNodes();
            for (var i = 0; i < allnode.length; i++) {
                var node = allnode[i];
                node.set_checked(false);
            }
            comboBox.trackChanges();
            comboBox.get_items().getItem(0).set_text("");
            comboBox.get_items().getItem(0).set_value("");
            comboBox.get_items().getItem(0).select();
            comboBox.commitChanges();
            comboBox.hideDropDown();
            $find("<%= ajaxManager.ClientID %>").ajaxRequest("<%=_REQ_REBIND_ACCOUNTNO%>");

        }

        function KeypreessEnter(sender, event) {
            var keyPressed;
            if (window.event)
                keyPressed = window.event.keyCode; // IE
            else
                keyPressed = event.which; // Firefox
            if (keyPressed == 13) {
                //var btnsearch = document.getElementById("MainContent_btnSearch"); //Chỉ sử dụng được khi main page có button Search được đặt tên btnSearch
                var btnsearch = new ControlFinder().getControlByCssClass("btnFind");
                if (btnsearch[0] != null)
                    btnsearch[0].click();
            }
        }
        function CheckNodeInCombo(sender, args) {
            var combo = $find("<%= cboOrgChart.ClientID %>");
            var node = args.get_node();
            var allnode = node.get_allNodes();
            var text = combo.get_text();
            var valueid = combo.get_value();
            var allnode_temp;
            var value_temp = ',';

            if (!node.get_checked()) {
                text = text.replace(node.get_text(), '');
                text = text.replace(',,', '');
                valueid = valueid.replace(node.get_value() + ',', '');

                if (text != '') {
                    text = node.get_text() + ',' + text;
                }
                else {
                    text = node.get_text();
                }
                valueid = node.get_value() + ',' + valueid;
            }
            else {

                text = text.replace(node.get_text() + ',', '');
                text = text.replace(node.get_text(), '');
                valueid = valueid.replace(node.get_value() + ',', '');

            }
            valueid = value_temp + valueid;
            
            combo.trackChanges();
            combo.get_items().getItem(0).set_text(text);
            combo.get_items().getItem(0).set_value(valueid);
            combo.get_items().getItem(0).select();
            combo.commitChanges();
        }
        function CheckNodeInProCombo(sender, args) {
            var combo = $find("<%= cboProChart.ClientID %>");
            var node = args.get_node();
            var allnode = node.get_allNodes();
            var text = combo.get_text();
            var valueid = combo.get_value();
            var allnode_temp;
            var value_temp = ',';

            if (!node.get_checked()) {
                text = text.replace(node.get_text(), '');
                text = text.replace(',,', '');
                valueid = valueid.replace(node.get_value() + ',', '');

                if (text != '') {
                    text = node.get_text() + ',' + text;
                }
                else {
                    text = node.get_text();
                }
                valueid = node.get_value() + ',' + valueid;
            }
            else {

                text = text.replace(node.get_text() + ',', '');
                text = text.replace(node.get_text(), '');
                valueid = valueid.replace(node.get_value() + ',', '');
                
            }
            
           // valueid = value_temp + valueid;

            combo.trackChanges();
            combo.get_items().getItem(0).set_text(text);
            combo.get_items().getItem(0).set_value(valueid);
            combo.get_items().getItem(0).select();
            combo.commitChanges();
            $find("<%= ajaxManager.ClientID %>").ajaxRequest("<%=_REQ_REBIND_ACCOUNTNO%>");
        }
        function CheckNodeInMgtCombo(sender, args) {
            var combo = $find("<%= cboMgtChart.ClientID %>");
            var node = args.get_node();
            var allnode = node.get_allNodes();
            var text = combo.get_text();
            var valueid = combo.get_value();
            var allnode_temp;
            var value_temp = ',';

            if (!node.get_checked()) {
                text = text.replace(node.get_text(), '');
                text = text.replace(',,', '');
                valueid = valueid.replace(node.get_value() + ',', '');

                if (text != '') {
                    text = node.get_text() + ',' + text;
                }
                else {
                    text = node.get_text();
                }
                valueid = node.get_value() + ',' + valueid;
            }
            else {

                text = text.replace(node.get_text() + ',', '');
                text = text.replace(node.get_text() , '');
                valueid = valueid.replace(node.get_value() + ',', '');
                
            }
            // valueid = value_temp + valueid;

            combo.trackChanges();
            combo.get_items().getItem(0).set_text(text);
            combo.get_items().getItem(0).set_value(valueid);
            combo.get_items().getItem(0).select();
            combo.commitChanges();
            $find("<%= ajaxManager.ClientID %>").ajaxRequest("<%=_REQ_REBIND_ACCOUNTNO%>");
        }
        function Nodenull() {
            var comboBox = $find("<%= cboOrgChart.ClientID %>");
            var treeview = $find("<%=trvOrgChartClientId %>");
            comboBox.trackChanges();
            comboBox.get_items().getItem(0).set_text("");
            comboBox.get_items().getItem(0).set_value("");
            comboBox.get_items().getItem(0).select();
            comboBox.commitChanges();
            comboBox.hideDropDown();

            var allnode = treeview.get_allNodes();
            for (var i = 0; i < allnode.length; i++) {
                var node = allnode[i];
                node.set_checked(false);
            }
        }
        function chkJobLevel_onclick() {
            var Level = document.getElementById("<%= txtLevel.ClientID %>");
            var combo = $find("<%= cboJobLevel.ClientID %>");

            var comboItems = combo.get_items();
            var text = "";
            var value = "";
            for (var i = 0; i < comboItems.get_count(); i++) {
                var item = comboItems.getItem(i);
                var checkboxes = GetControlByType("checkbox", "<%= cboJobLevel.ClientID %>" + "_i" + i.toString());
                if (checkboxes != null && checkboxes.length > 0) {
                    if (checkboxes[0].checked) {
                        if (text != "") text = text + "; ";
                        text = text + item.get_text();

                        if (value != "") value += ";";
                        value = value + item.get_value();
                    }
                }

            }
            
            Level.value = value
            $find("<%= ajaxManager.ClientID %>").ajaxRequest("<%=_REQ_REBIND_ACCOUNTNO%>");
        } 
        function chkChart_onclick() {
            
            $find("<%= ajaxManager.ClientID %>").ajaxRequest("<%=_REQ_REBIND_ACCOUNTNO%>");
        }
        function SetEmpty(sender, event) {
            if (sender.get_value() == "") {
                sender.set_text("");
            }
        }
    </script>
</telerik:RadCodeBlock>
